package com.atguigu.lease.common.exception;

import com.atguigu.lease.common.result.Result;
import com.atguigu.lease.common.result.ResultCodeEnum;
import lombok.Data;
import org.springframework.context.annotation.Configuration;

@Data
public class LeaseException extends RuntimeException{

    //返回码
    private Integer code;

    public LeaseException(String message,Integer code){
        super(message);
        this.code=code;
    }

    public LeaseException(ResultCodeEnum resultCodeEnum){
        super(resultCodeEnum.getMessage());
        this.code = resultCodeEnum.getCode();
    }


}
